package com.huawei.appmarket.service.usercenter.personal.view.card;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.appmgr.view.activity.AppManagerProtocol;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant.KeyAndValue;
import java.util.ArrayList;
import java.util.List;
import o.cgo;
import o.cgz;
import o.cjk;
import o.cjm;
import o.cjo;
import o.ckt;
import o.der.e;
import o.der.f;
import o.djp;
import o.dss;
import o.eko;
import o.ekp;
import o.ekr;
import o.MinimumFactory;

public class PersonalGameCard extends PersonalNormalCard implements OnClickListener {
    private int ॱ;

    public PersonalGameCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        this.ʿ.setText(f.ﹳॱ);
        ˏ(this.ˎ, e.ˋॱ);
        view.setOnClickListener(new ckt(this));
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        ˎ();
        ᐝ();
    }

    private void ˎ() {
        List arrayList = new ArrayList();
        arrayList.addAll(dss.ॱ().ˎ(true, 1));
        arrayList.addAll(dss.ॱ().ॱ(true, 1));
        this.ॱ = arrayList.size();
    }

    private void ᐝ() {
        if (this.ॱ > 0) {
            this.ˋ.setVisibility(0);
            this.ˋ.setText(MinimumFactory.double2String((double) this.ॱ));
        } else {
            this.ˋ.setVisibility(8);
        }
        boolean ˋ = djp.ˎ().ˋ();
        boolean z;
        if (djp.ˎ().ˊ()) {
            z = false;
        } else {
            z = true;
        }
        if (ˋ && r0) {
            ekr.ॱ(ekp.ˎ, ekr.ˋ);
            ˎ(true);
            return;
        }
        ekr.ॱ(ekp.ˎ, ekr.ˎ);
        ˎ(false);
    }

    public void onClick(View view) {
        ekr.ॱ(ekp.ˎ, ekr.ˎ);
        ˊ();
        ˋ();
    }

    protected void ˋ() {
        cgo.ˋ("3", "myGame", 5);
        eko.ˎ(f.ᐝˊ, KeyAndValue.NUMBER_01);
    }

    protected void ˊ() {
        cjo appManagerProtocol = new AppManagerProtocol();
        appManagerProtocol.ˊ().ॱ(true);
        cjk.ˎ().ˋ(this.ˊ, new cjm("installmgr.activity", appManagerProtocol));
    }
}
